home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************\
- **
- ** XTLite.h
- **
- ** Header file needed for all QuarkXPress XTLite XTensions.
- **
- **
- ** Copyright © 1993,1994 Quark Incorporated
- ** All Rights Reserved
- **
- \**************************************************************************/
-
- #ifndef PLATFORMPOWERPC
- #define PLATFORMPOWERPC 0
- #endif
- #ifndef PLATFORMMAC
- #define PLATFORMMAC 1
- #endif
-
- #ifndef __NEWTYPES
- #define __NEWTYPES
- /* Replacement types */
- /* Apple SANE numeric formats */
- typedef short double float64;
- typedef double float96;
- /* Signed things */
- typedef char int8;
- typedef short int16;
- typedef long int32;
- /* Unsigned things */
- typedef unsigned int ubitfield;
- typedef unsigned char uint8;
- typedef unsigned char uchar;
- typedef Boolean bool8;
- typedef int16 bool16;
- typedef unsigned short uint16;
- typedef unsigned long uint32;
- typedef unsigned bitfield;
-
- #define BOOL bool16
- #endif /* __NEWTYPES */
-
- #if PLATFORMPOWERPC
- /* Don't allow the old types to be used. These can be
- ** undef'ed in any file that requires them. */
- #define int DieINT
- #define long DieLONG
- #define unsigned DieUNSIGNED
- #define Boolean DieBOOLEAN
-
- #define main xtmain
-
- #define TRUE 1
- #define FALSE 0
- #define OK 1
- #define Cancel 2
- #endif /* PLATFORMPOWERPC */
-
- #define ISSPECIAL(z) (((15L<<commandMark)>>(z))&1 != 0)
- #define ISLINECHAR(z) ((z) <= RETURNCHAR && ((z) >= PARAGRAPH || (z) == HARDRETURN))
- #define ISPARACHAR(z) ((z) <= RETURNCHAR && (z) >= PARAGRAPH)
-
- /***************************************************************************/
- /* */
- /* line justification values */
- /* */
- /***************************************************************************/
- #define LEFT 0
- #define CENTER 1
- #define RIGHT 2
- #define JUST 3
-
- /***************************************************************************/
- /* */
- /* tab alignment values */
- /* */
- /***************************************************************************/
- #define TABLEFT 0
- #define TABCENTER 1
- #define TABRIGHT 2
- #define TABALIGNON 3
- #define TABDECIMAL 3 /* for backward compatibility */
-
- /***************************************************************************/
- /* */
- /* constants for character styles */
- /* */
- /***************************************************************************/
- #define PLAIN 0
- #define SUPERSCRIPT 0x20
- #define SUBSCRIPT 0x40
- #define NONBREAKING 0x80
- #define SUPERIOR 0x100
- #define STRIKETHRU 0x200
- #define ALLCAPS 0x400
- #define SMALLCAPS 0x800
- #define WUNDERLINE 0x1000
-
- /***************************************************************************/
- /* */
- /* special characters */
- /* */
- /***************************************************************************/
- #define BREAKCHAR 0x00 /* Special marker for conditional line breaks */
- #define HARDRETURN 0x07 /* hard return */
- #define TABCHAR ('I'-64) /* tab character */
- #define PARAGRAPH 0x0B /* PARAGRAPH..RETURNCHAR are paragraph markers */
- #define NEWCOLUMN 0x0B /* new column character */
- #define NEWBOX 0x0C /* new box character */
- #define RETURNCHAR 0x0D /* end of paragraph mark */
- #define DISCRETIONARYRETURN 0x1D /* discretionary return character */
- #define TEMPMARGIN 0x1E /* Temporary margin character (indent here) */
- #define INVISCHAR ('U'-64) /* ASCII code of first invisible character */
- #define SOFTHYPHEN 0x1F /* discretionary hyphen character */
- #define NSPACECHAR 0xCA /* en space character */
- #define FLEXSPACECHAR 0x0F /* Flex space (normally quarter of an em space) */
- #define PUNCSPACECHAR 0x10 /* space the width of a '.' */
-
-
- /***************************************************************************/
- /* */
- /* Min and Max values for attributes */
- /* */
- /***************************************************************************/
- #define MINSIZE (2L<<16)
- #define MAXSIZE (720L<<16)
- #define MINSCALE (40L<<8)
- #define MAXSCALE (4L<<16)
- #define MINSHADE (0L)
- #define MAXSHADE (1L<<16)
- #define MINKERN (-500L<<16)
- #define MAXKERN (500L<<16)
- #define MINTRACK MINKERN
- #define MAXTRACK MAXKERN
-
- /***************************************************************************/
- /* */
- /* Text Attributes record */
- /* */
- /***************************************************************************/
- typedef struct {
- int16 font; /* Font id */
- int16 face; /* Face (style) flags */
- Fixed size; /* Font size (between 2 and 720 pt) */
- Fixed hscale; /* Horizontal scale factor between 25 and 400% (1.0 is 100%) */
- Fixed shade; /* 1.0 is 100% (between 0 and 100%) */
- Fixed kern; /* Fractional 200ths em (-500 to 500) */
- Fixed track; /* Fractional 200ths em (-500 to 500) */
- } filtertxtattrib,*filtertxtattribptr,**filtertxtattribhandle;
-
- /***************************************************************************/
- /* */
- /* Text Attributes defines */
- /* */
- /***************************************************************************/
- #define T_FONT 1
- #define T_FACE 2
- #define T_SIZE 3
- #define T_HSCALE 4
- #define T_SHADE 7
- #define T_KERN 8
- #define T_TRACK 9
-
- /***************************************************************************/
- /* */
- /* Tab Specifications record */
- /* */
- /***************************************************************************/
- typedef struct {
- Byte tabjust; /* TABLEFT,TABCENTER,TABRIGHT,TABALIGNON */
- Byte alignon; /* byte to align on when TABALIGNON */
- Byte tablead; /* character to fill tab with */
- Fixed tabindent; /* Offset to tab */
- } filtertabspec;
-
- /***************************************************************************/
- /* */
- /* Paragraph Attributes record */
- /* */
- /***************************************************************************/
- typedef struct {
- bool8 relative; /* Boolean attributes */
- Byte just; /* LEFT, CENTER, RIGHT, JUSTified */
- Fixed leftindent; /* Left Indent (relative to column/box left edge) */
- Fixed firstindent; /* First Line Indent (relative to "leftindent") */
- Fixed rightindent; /* Right Indent (relative to column/box right edge) */
- Fixed leading; /* 0 means “auto” leading */
- Fixed spcbefore; /* Space Before paragraph */
- Fixed spcafter; /* Space After paragraph */
- filtertabspec tabs[]; /* User tabs */
- } filterparaattrib,*filterparaattribptr,**filterparaattribhandle;
-
- /***************************************************************************/
- /* */
- /* Paragraph Attributes defines */
- /* */
- /***************************************************************************/
- #define P_RELATIVE 3
- #define P_JUST 18
- #define P_LEFTINDENT 26
- #define P_FIRSTINDENT 27
- #define P_RIGHTINDENT 28
- #define P_LEADING 29
- #define P_SPCBEFORE 30
- #define P_SPCAFTER 31
-
- /* function prototypes */
- void setupfilter(OSType *,OSType *,bool8 *,bool8 *,Str255,Str255,Str255);
- bool8 setupmenu(Str255);
- bool8 setupidle(void);
- void startread(int16);
- void readtext(int16, Str255, int32 *, filtertxtattrib *, filterparaattrib *, RGBColor *);
- void endread(int16);
- void startwrite(int16);
- void writetext(int16, Str255, int32, filtertxtattrib *, filterparaattrib *, RGBColor *);
- void endwrite(int16);
- int16 convertcolor(uint16,uint16,uint16);
- int16 maxnumoftabs(void);
- void menucall(void);
- void idlecall(EventRecord *);
-
- bool8 istextboxcurrent(void);
- bool8 gettextinfo(int32 *selectionstart,int32 *selectionend,int32 *totallength);
- bool8 inserttext(int32 numberofcharacters,uchar *textstr,int32 offset);
- bool8 gettext(int32 offset,int32 numberofcharacters,uchar *textstr);
- bool8 deletetext(int32 offset,int32 numberofcharacters);
- bool8 gettextattribute(int16 whichattribute,Fixed *attribute,int32 startoffset,int32 endoffset);
- bool8 settextattribute(int16 whichattribute,Fixed attribute,int32 startoffset,int32 endoffset,
- bool16 redrawtext);
- bool8 getparaattribute(int16 whichattribute,Fixed *attribute,int32 startoffset,int32 endoffset);
- bool8 setparaattribute(int16 whichattribute,Fixed attribute,int32 startoffset,int32 endoffset,
- bool16 redrawtext);
- bool8 turnofftextselection(void);
- bool8 settextselection(int32 startoffset,int32 endoffset);
-